home *** CD-ROM | disk | FTP | other *** search
- -- Wait a second and then do this:
-
- -- Don't allow you to exit the game ... yet:
- G.SetPause( false );
-
- MainMenu.OpenWindow( "InGameExitWindow", true);
-
- KillTextPopup();
-
- if( KillCinemaBars ~= nil ) then KillCinemaBars() end
-
- G.OnlyShowMouseOnGui( false );
- G.DisableTrapAll()
- -- G.SetCursorActive( false );
- Cursor.SetVelocity( Vector3(0,0,0) )
-
- -- Set the text:
- gameovertext = LevelExitDesc()
- MainMenu.Message( "InGameOver", "SetText", gameovertext );
-
- -- Stop the in-game music, play victory/loss music:
- G.StopMusic();
- if( GameState == Victory ) then
- G.LoadSong("Music/invasion_resisted.mp3");
- else
- G.LoadSong("Music/invasion_unopposed.mp3");
- end
-
- G.SetNextLoopingMusic( "Music/moxie_socks.mp3" );
-
-
- -- Change invaders so that they stop attacking!
-
- -- If the tower WAS still there, move the camera to it:
- -- Camera.SetPosition( Tower.GetPosition() )
-
- -- Wait until the player acknoledges the loss:
- function AcknowledgeGameEnd()
-
- KillImagePopup();
-
- -- Stop traitor Wah-wah
- G.SimpleStopSound( "TraitorTalk" );
-
- -- gameovertext = LevelExitDesc();
- GameOverScreen( gameovertext );
-
- MainMenu.CloseWindow( "InGameExitWindow", false);
-
- -- Stop spawning:
- EndAllWaves()
-
- G.DestroyGroup("invaders");
- G.DestroyGroup("spawners");
- G.DestroyGroup("tower");
- G.DestroyGroup("traps");
- G.DestroyGroup("walls");
- G.DestroyGroup("doodads");
- G.DestroyGroup("effects");
- G.DestroyGroup("cursor");
- G.DestroyGroup("camera");
- G.DestroyGroup("level");
-
- HUD.Destroy();
- Cursor.Destroy();
- G.OnlyShowMouseOnGui( false );
-
- -- This is for the "Retry/Next Level" Button
- if( not(InCampaign) or CurrentLevel == MaxLevelNum ) then
- MainMenu.CloseWindow( "NextLevel", false );
- else
- if( GameState == Victory ) then
- MainMenu.Message( "NextLevel", "SetText", "Go To Next Level" );
- else
- MainMenu.Message( "NextLevel", "SetText", "Retry Level" );
- end
-
- MainMenu.OpenWindow( "NextLevel", false );
- end
-
- MainMenu.OpenWindow( "GameOverWindow", false);
-
- G.SetPause( false );
- DeactivateTraitor(); -- DisableTraitor();
-
-
- G.LogicCleanUp();
-
- end
-
-
-
-
-
-
-
-
-
-
-
-
-
-